package com.ruoyi.service.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.service.mapper.DiscountMapper;
import com.ruoyi.service.domain.Discount;
import com.ruoyi.service.service.IDiscountService;
import com.ruoyi.common.support.Convert;

/**
 * 优惠电费 服务层实现
 * 
 * @author john
 * @date 2019-01-04
 */
@Service
public class DiscountServiceImpl implements IDiscountService 
{
	@Autowired
	private DiscountMapper discountMapper;

	/**
     * 查询优惠电费信息
     * 
     * @param id 优惠电费ID
     * @return 优惠电费信息
     */
    @Override
	public Discount selectDiscountById(Integer id)
	{
	    return discountMapper.selectDiscountById(id);
	}
	
	/**
     * 查询优惠电费列表
     * 
     * @param discount 优惠电费信息
     * @return 优惠电费集合
     */
	@Override
	public List<Discount> selectDiscountList(Discount discount)
	{
	    return discountMapper.selectDiscountList(discount);
	}
	
    /**
     * 新增优惠电费
     * 
     * @param discount 优惠电费信息
     * @return 结果
     */
	@Override
	public int insertDiscount(Discount discount)
	{
	    return discountMapper.insertDiscount(discount);
	}
	
	/**
     * 修改优惠电费
     * 
     * @param discount 优惠电费信息
     * @return 结果
     */
	@Override
	public int updateDiscount(Discount discount)
	{
	    return discountMapper.updateDiscount(discount);
	}

	/**
     * 删除优惠电费对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteDiscountByIds(String ids)
	{
		return discountMapper.deleteDiscountByIds(Convert.toStrArray(ids));
	}
	
}
